function adjMatrix = edgesToAdjMatrix(edges)
    % 确定节点数量
    numNodes = max(max(edges(:, 1)), max(edges(:, 2)));
    
    % 初始化邻接矩阵，初始值为无穷大
    adjMatrix = inf(numNodes);
    
    % 填充邻接矩阵
    for k = 1:size(edges, 1)
        u = edges(k, 1);
        v = edges(k, 2);
        weight = edges(k, 3);
        adjMatrix(u, v) = weight;
    end

end



